package com.qianfeng.qlm.handforireader.model;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by LinXiangLin on 2015/3/25.
 */
public class NewContentBeanList {

    private List<NewContentBean> data;

    public void parseJson(JSONObject jsonObject){
        if (jsonObject != null){
            try {
                JSONArray comicPagerArr = jsonObject.getJSONArray("comic_pager_arr");
                if (comicPagerArr != null){
                    data = new ArrayList<>();
                    for (int i = 0; i < comicPagerArr.length();i++){
                        NewContentBean contentBean = new NewContentBean();
                        JSONObject comicPagerArrJSONObject = comicPagerArr.getJSONObject(i);
                        contentBean.parseJson(comicPagerArrJSONObject);
                        data.add(contentBean);
                    }
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }

    public List<NewContentBean> getData() {
        return data;
    }

    public void setData(List<NewContentBean> data) {
        this.data = data;
    }
}
